﻿<phone:PhoneApplicationPage 
    x:Class="DDU.Curriculum.Views.FictionsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:viewmodel="clr-namespace:DDU.ViewModel;assembly=DDU.ViewModel"
    xmlns:Converters="clr-namespace:DDU.Converters;assembly=DDU.Converters"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False" >
    <phone:PhoneApplicationPage.Resources>
        <Converters:StreamToImageConverter x:Key="StreamToImageConverter" />
    </phone:PhoneApplicationPage.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush Stretch="Fill" ImageSource="/Assets/back.png"/>
        </Grid.Background>
        <Grid.DataContext>
            <viewmodel:FictionsViewModel/>
        </Grid.DataContext>
        <controls:Panorama>
            <controls:Panorama.Title>
                <Image Source="{Binding LogoPath}" Margin="12,76,0,0"/>
            </controls:Panorama.Title>
            
            <!--Panorama item one-->
            <controls:PanoramaItem Header="天天小说">
                <Grid>
                    <ListBox ItemsSource="{Binding Path=ItemsOfFictions}">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <toolkit:WrapPanel></toolkit:WrapPanel>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <toolkit:HubTile Margin="12,0,0,12" Message="{Binding Title}" Source="{Binding Path=Cover, Converter={StaticResource StreamToImageConverter}}" Tap="StartRead" Tag="{Binding Path=FileName}" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PanoramaItem>

            <!--Panorama item two-->
            <controls:PanoramaItem Header="在线书柜">
                <Grid/>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>

    <!--Panorama-based applications should not show an ApplicationBar-->

</phone:PhoneApplicationPage>